
package com.probiz.estore;

/**
 * 全局性的常量类
 * 
 * 
 * 1.所有常量命名一律大写，用"_"分割单词
 * 
 */
public class Constants {

	/**
	 * 是/通过/成功/激活
	 */
	public final static Short	FLAG_TRUE							= Short.valueOf((short) 1);
	/**
	 * 否/不通过/失败/禁用
	 */
	public final static Short	FLAG_FALSE							= Short.valueOf((short) 0);

	public static final Short	ADDRESS_TYPE_BILLING				= Short.valueOf((short) 2);

	public static final Short	ADDRESS_TYPE_COMPANY				= Short.valueOf((short) 3);

	public static final Short	ADDRESS_TYPE_PERSONAL				= Short.valueOf((short) 0);

	public static final Short	ADDRESS_TYPE_SHIPPING				= Short.valueOf((short) 1);

	public static final Short	PaymentHistory_FLAG_SUCCESS			= Short.valueOf((short) 1);
	/**
	 * 超级管理员角色名称
	 */
	public static final String	ADMIN_ROLE							= "admin";
	/**
	 * default role name for administrator user.
	 */
	public static final String	DEFAULT_ADMIN_ROLE_NAME				= "admin";

	/**
	 * default user name for administrator user.
	 */
	public static final String	DEFAULT_ADMIN_USER_NAME				= "admin";
	/**
	 * 默认运行环境用户
	 */
	public static final String	ANONYMOUS_USER_NAME					= "ANONYMOUS_USER";
	
	public static final String	SYSTEM_USER_NAME					= "系统自动";
	/**
	 * The name of the configuration hashmap stored in application scope
	 */
	public static final String	CONFIG								= "appConfig";
	/**
	 * CONTEXT_PATH
	 */
	public static final String	CONTEXT_PATH						= "ctxPath";

	/**
	 * client cookie 's maxage
	 */
	public static int			COOKIE_DEFAULT_MAXAGE				= 15;
	/**
	 * estore Cookie Name
	 */
	public static final String	COOKIE_NAME							= "eStore";
	/**
	 * CUR_LOCALE_CODE
	 */
	public static final String	CUR_LOCALE_CODE						= "CUR_LOCALE_CODE";
	/**
	 * menu key
	 */
	public final static String	KEY_MENU_CONTEXT					= "ProBIZMenuContext";
	/**
	 * 后台头部菜单，被选中菜单的信息保存在request中的key
	 */
	public final static String	SELECTED_MENU_MAP					= "selectedMenuMap";

	/**
	 * 系统操作时所对应的用户名 类似日志审计有addedBy字段时
	 */
	public static final String	DEFAULT_SYSTEM_USER_NAME			= "SYSTEM";
	/**
	 * 默认字符集编码
	 */
	public static final String	DEFAULT_ENCODING					= "UTF-8";

	/**
	 * File separator from System properties
	 */
	public static final String	FILE_SEP							= System
																			.getProperty("file.separator");
	/**
	 * 路径分隔符
	 */
	public static final String	CATEGORY_PATH_NAME_SEP				= "/";

	/**
	 * log4j配置文件路径
	 */
	public static final String	LOG4J_CONFIG_LOCATION				= "/WEB-INF/classes/conf/log4j.properties";

	/**
	 * page前缀
	 */
	public static final String	PAGES_PREFIX						= "/pages/";
	/**
	 * 在线支付历史,失败
	 */
	public static final Short	PAYMENT_HISTORY_FLAG_FAILURE		= Short.valueOf((short) 0);

	/**
	 * 在线支付历史,成功
	 */
	public static final Short	PAYMENT_HISTORY_FLAG_SUCCESS		= Short.valueOf((short) 1);
	/**
	 * 在线支付历史,等待
	 */
	public static final Short	PAYMENT_HISTORY_FLAG_WAIT			= Short.valueOf((short) -1);

	public static final int		PAYMENT_HISTORY_RESPONSE_NEVER		= 0;
	public static final int		PAYMENT_HISTORY_RESPONSE_SUCCESS	= 1;
	public static final int		PAYMENT_HISTORY_RESPONSE_FAILURE	= 2;
	
	
	public static final String PREFERRED_LOCALE = "preferredLocale";
	/**
	 * Session scope attribute that holds the locale set by the user. By setting
	 * this key to the same one that JSTL uses, we get synchronization in JSTL
	 * w/o having to do extra work or have two session-level variables. Append
	 * .session to Config.FMT_LOCALE
	 */
	public static final String	PREFERRED_LOCALE_KEY				= "javax.servlet.jsp.jstl.fmt.locale.session";

	public static final String	QUERY_BEGINWITH						= "beginWith";
	public static final String	QUERY_BETWEEN						= "between";
	public static final String	QUERY_ENDWITH						= "endWith";
	public static final String	QUERY_EQUALS						= "eq";
	public static final String	QUERY_GREATTHAN						= "gt";
	public static final String	QUERY_IN							= "in";
	public static final String	QUERY_LESSTHAN						= "lt";
	public static final String	QUERY_LIKE							= "like";

	/**
	 * 根路径id
	 */
	public final static Integer	ROOT_CATEGORY						= new Integer(
																			"1");
	/**
	 * 根路径path
	 */
	public final static String	ROOT_CATEGORY_PATH					= "1";

	/**
	 * 未发布，或未完成，也可理解为草稿状态
	 */
	public static final Short	STATUS_NOT_PUBLISHED				= Short.valueOf(
																			"0");
	/** Status:Active */
	public static final Short	STATUS_ACTIVE						= Short.valueOf(
																			"1");
	/** Status:Inactive */
	public static final Short	STATUS_INACTIVE						= Short.valueOf(
																			"2");
	/** Status:Deleted */
	public static final Short	STATUS_DELETED						= Short.valueOf(
																			"3");
	/** Status:Expired */
	public static final Short	STATUS_EXPIRED						= Short.valueOf(
																			"4");
	/** Status:Upcoming */
	public static final Short	STATUS_UPCOMING						= Short.valueOf(
																			"5");
	/** Status:等待删除 */
	public static final Short	STATUS_AWAITING_DELETE				= Short.valueOf(
																			"6");
	/** Status:隐藏 */
	public static final Short	STATUS_HIDDEN						= Short.valueOf(
																			"7");
	/** not sent 0 */
	public static final Short	STATUS_NOT_SENT						= Short.valueOf(
																			"0");
	/** sent 1 */
	public static final Short	STATUS_SENT							= Short.valueOf(
																			"1");

	/**
	 * Default locale used in this application, define in database, cache here
	 * only.
	 */
	public static String		SYSTEM_LOCALE_CODE					= "zh_CN";

	/**
	 * user.home
	 */
	public static final String	USER_HOME							= System
																			.getProperty("user.home")
																			+ FILE_SEP;

	public final static String	DEFAULT_USERNAME					= "ANONYMOUS USER";
	public final static Integer	USERID_ANONYMOUS					= Integer.valueOf(-2);
	public final static Integer	USERID_SYSTEM						= Integer.valueOf(-1);
	/**
	 * velocity前缀
	 */
	public static final String	VELOCITY_PREFIX						= "/velocity/";

	/**
	 * 商品类型 产品
	 */
	public static final Short	ITEM_TYPE_PRODUCT					= Short.valueOf(
																			"1");
	/**
	 * 商品类型 礼券
	 */
	public static final Short	ITEM_TYPE_GC						= Short.valueOf(
																			"2");
	/**
	 * 商品类型 礼品
	 */
	public static final Short	ITEM_TYPE_GIFT						= new Short(
																			"3");
	/**
	 * 客户激活模式：立即
	 */
	public static final Short	CUSTOMER_ACTIVE_NOW					= Short.valueOf(
																			"0");
	/**
	 * 客户激活模式：发送确认邮件
	 */
	public static final Short	CUSTOMER_ACTIVE_EMAIL				= Short.valueOf(
																			"1");

	/**
	 * 客户激活模式：后台人工激活
	 */
	public static final Short	CUSTOMER_ACTIVE_MANUAL				= Short.valueOf(
																			"2");
	/**
	 * 前台登录前跳转参数key
	 */
	public static final String	SAVED_URL_KEY						= "continue";

	/** 登录调回key* */
	public static final String	SAVED_REQUEST_KEY					= "SAVED_REQUEST_KEY";
	/**
	 * 真正的url
	 */
	public static final String	PRE_URL								= "preUrl";
	/**
	 * Trigger的状态
	 * 
	 * @see org.quartz.Trigger#STATE_NORMAL 0 正常
	 * @see org.quartz.Trigger#STATE_PAUSED 1 停止
	 * @see org.quartz.Trigger#STATE_COMPLETE 2 完成，已经不需运行
	 * @see org.quartz.Trigger#STATE_ERROR 3 错误
	 * @see org.quartz.Trigger#STATE_BLOCKED 4 阻塞，运行中
	 * 
	 */
	/**
	 * 后台Belongto值
	 */
	public static final Short	SECURITY_BELONGTO_ADMIN				= Short.valueOf(
																			"0");
	/**
	 * 前台Belongto值
	 */
	public static final Short	SECURITY_BELONGTO_FRONT				= Short.valueOf(
																			"1");
	/**
	 * appmenu.type=1表示菜单
	 */
	public static final Short	SECURITY_TYPE_MENU					= Short.valueOf(
																			"1");
	/**
	 * appmenu.type=0表示资源
	 */
	public static final Short	SECURITY_TYPE_RESOURCE				= Short.valueOf(
																			"0");
	
	/**
	 * 地区 世界id
	 */
	public static final Integer REGIONID_WORLD = Integer.valueOf(1);
	/**
	 * 地区 中国id
	 */
	public static final Integer REGIONID_CHINA = Integer.valueOf(78254);
	/**
	 * 用户自定义地区regionType
	 */
	public static final Integer REGIONI_TYPE_USERDEFINED = Integer.valueOf(-1);
	public static Short getPaymentHistory_FLAG_SUCCESS() {
		return PaymentHistory_FLAG_SUCCESS;
	}
	
	public final static Short	KUAIDI100_TYPE_1= Short.valueOf((short) 1); // 使用APIOne接口，查询最新一行的结果
	public final static Short	KUAIDI100_TYPE_2= Short.valueOf((short) 2); // 使用API接口，返回完整结果
	
	/**
	 * 表单绑定decimal格式
	 */
	public final static String		BINDER_DECIMAL_FORMAT	= "#.##";
	
	/**
	 * 允许添加购物车商品最大数量
	 */
	public final static Integer MAX_BUY_NUM           =  Integer.valueOf(99999);
}
